package kr.hkit.powerjava.chapter11;

public class Student {

	private int stdNum;
	private String stdName;

	public Student(int stdNum, String stdName) {
		this.stdNum = stdNum;
		this.stdName = stdName;
	}

	@Override
	public boolean equals(Object obj) {
		if(obj instanceof Student){
			return (this.stdName == ((Student)obj).stdName)&&(this.stdNum==((Student)obj).stdNum);
		}
		return false;
	}

	public static void main(String[] args) {
		Student std1 = new Student(1, "김태희");
		Student std2 = new Student(1, "김태희");

		System.out.println(std1.equals(std2) ? "같다" : "다르다");
	}

}
